﻿using System;

namespace Cactussoft.Common.Logging
{
    /// <summary>
    /// Interface for logging extensions. Represents a set of operations suitable during logging usage.
    /// </summary>
    public interface ILogger
    {
        bool IsLogEnabled { get; }
        bool IsDebugEnabled { get; }
        bool IsTraceEnabled { get; }
        bool IsInfoEnabled { get; }
        bool IsWarnEnabled { get; }
        bool IsErrorEnabled { get; }
        bool IsFatalEnabled { get; }

        /// <summary>
        /// Logs information message.
        /// </summary>
        /// <param name="message">Message.</param>
        void Info(string message);
        /// <summary>
        /// Logs information message using format string and set of arguments.
        /// </summary>
        /// <param name="messageFormat">Message format string.</param>
        /// <param name="args">Set of arguments for format string.</param>
        void Info(string messageFormat, params object[] args);
        /// <summary>
        /// Logs information message with exception.
        /// </summary>
        /// <param name="message">Message.</param>
        /// <param name="exception"><see cref="Exception">Exception</see>.</param>
        void Info(string message, Exception exception);

        /// <summary>
        /// Logs debug message.
        /// </summary>
        /// <param name="message">Message.</param>
        void Debug(string message);
        /// <summary>
        /// Logs debug message using format string and set of arguments.
        /// </summary>
        /// <param name="messageFormat">Message format string.</param>
        /// <param name="args">Set of arguments for format string.</param>
        void Debug(string messageFormat, params object[] args);
        /// <summary>
        /// Logs debug message with exception.
        /// </summary>
        /// <param name="message">Message.</param>
        /// <param name="exception"><see cref="Exception">Exception</see>.</param>
        void Debug(string message, Exception exception);

        /// <summary>
        /// Logs trace message.
        /// </summary>
        /// <param name="message">Message.</param>
        void Trace(string message);
        /// <summary>
        /// Logs trace message using format string and set of arguments.
        /// </summary>
        /// <param name="messageFormat">Message format string.</param>
        /// <param name="args">Set of arguments for format string.</param>
        void Trace(string messageFormat, params object[] args);
        /// <summary>
        /// Logs trace message with exception.
        /// </summary>
        /// <param name="message">Message.</param>
        /// <param name="exception"><see cref="Exception">Exception</see>.</param>
        void Trace(string message, Exception exception);

        /// <summary>
        /// Logs warning message.
        /// </summary>
        /// <param name="message">Message.</param>
        void Warn(string message);
        /// <summary>
        /// Logs warning message using format string and set of arguments.
        /// </summary>
        /// <param name="messageFormat">Message format string.</param>
        /// <param name="args">Set of arguments for format string.</param>
        void Warn(string messageFormat, params object[] args);
        /// <summary>
        /// Logs warning message with exception.
        /// </summary>
        /// <param name="message">Message.</param>
        /// <param name="exception"><see cref="Exception">Exception</see>.</param>
        void Warn(string message, Exception exception);

        /// <summary>
        /// Logs error message.
        /// </summary>
        /// <param name="message">Message.</param>
        void Error(string message);
        /// <summary>
        /// Logs error message using format string and set of arguments.
        /// </summary>
        /// <param name="messageFormat">Message format string.</param>
        /// <param name="args">Set of arguments for format string.</param>
        void Error(string messageFormat, params object[] args);
        /// <summary>
        /// Logs error message with exception.
        /// </summary>
        /// <param name="message">Message.</param>
        /// <param name="exception"><see cref="Exception">Exception</see>.</param>
        void Error(string message, Exception exception);
        /// <summary>
        /// Logs error exception.
        /// </summary>
        /// <param name="exception"><see cref="Exception">Exception</see>.</param>
        void Error(Exception exception);

        /// <summary>
        /// Logs fatal error message.
        /// </summary>
        /// <param name="message">Message.</param>
        void Fatal(string message);
        /// <summary>
        /// Logs fatal error message using format string and set of arguments.
        /// </summary>
        /// <param name="messageFormat">Message format string.</param>
        /// <param name="args">Set of arguments for format string.</param>
        void Fatal(string messageFormat, params object[] args);
        /// <summary>
        /// Logs fatal error message with exception.
        /// </summary>
        /// <param name="message">Message.</param>
        /// <param name="exception"><see cref="Exception">Exception</see>.</param>
        void Fatal(string message, Exception exception);
        /// <summary>
        /// Logs fatal error exception.
        /// </summary>
        /// <param name="exception"><see cref="Exception">Exception</see>.</param>
        void Fatal(Exception exception);
    }
}
